import crafttweaker.item.IItemStack;
import crafttweaker.item.IIngredient;
import crafttweaker.liquid.ILiquidStack;
import crafttweaker.oredict.IOreDict;
import crafttweaker.oredict.IOreDictEntry;
import crafttweaker.data.IData;

// Modular Machinery Recipe Rebuild

recipes.removeByMod("modularmachinery");

// Modularium
val imodularium = <modularmachinery:itemmodularium>;
val nmodularium = <additions:hsadd-nuggetmodularium>;
recipes.addShaped(
    <additions:hsadd-blockmodularium>*9,[
        [imodularium,imodularium,imodularium],
        [imodularium,imodularium,imodularium],
        [imodularium,imodularium,imodularium]
    ]
);
recipes.addShapeless(
    modularium*9,[
        <additions:hsadd-blockmodularium>
    ]
);
recipes.addShaped(
    <modularmachinery:itemmodularium>*1,[
        [nmodularium,nmodularium,nmodularium],
        [nmodularium,nmodularium,nmodularium],
        [nmodularium,nmodularium,nmodularium]
    ]
);
recipes.addShapeless(
    nmodularium*9,[
        <modularmachinery:itemmodularium>
    ]
);

// Tiny Item Input Bus
recipes.addShaped(
    <modularmachinery:blockinputbus>*1,[
        [null,<minecraft:redstone>,null],
        [<modularmachinery:itemmodularium>,<minecraft:hopper>,<modularmachinery:itemmodularium>],
        [null,<modularmachinery:blockcasing>,null]
    ]
);

// Small Item Input Bus
recipes.addShaped(
    <modularmachinery:blockinputbus:1>*1,[
        [null,<minecraft:hopper>,null],
        [<minecraft:redstone>,<minecraft:hopper>,<minecraft:redstone>],
        [<modularmachinery:itemmodularium>,<modularmachinery:blockinputbus>,<modularmachinery:itemmodularium>]
    ]
);

// Tiny Item Output Bus
recipes.addShaped(
    <modularmachinery:blockoutputbus>*1,[
        [null,<modularmachinery:blockcasing>,null],
        [<modularmachinery:itemmodularium>,<minecraft:hopper>,<modularmachinery:itemmodularium>],
        [null,<minecraft:redstone>,null]
    ]
);

recipes.addShapeless(
    <modularmachinery:blockoutputbus>*1,[
        <modularmachinery:blockinputbus>,<minecraft:redstone_torch>
    ]
);

// Small Item Output Bus
recipes.addShaped(
    <modularmachinery:blockoutputbus:1>*1,[
        [<modularmachinery:itemmodularium>,<modularmachinery:blockoutputbus>,<modularmachinery:itemmodularium>],
        [<minecraft:redstone>,<minecraft:hopper>,<minecraft:redstone>],
        [null,<minecraft:hopper>,null]
    ]
);

// Tiny Fluid Input Hatch
recipes.addShaped(
    <modularmachinery:blockfluidinputhatch>*1,[
        [null,<minecraft:bucket>,null],
        [<modularmachinery:itemmodularium>,<minecraft:bucket>,<modularmachinery:itemmodularium>],
        [null,<modularmachinery:blockcasing>,null]
    ]
);

// Small Fluid Input Hatch
recipes.addShaped(
    <modularmachinery:blockfluidinputhatch:1>*1,[
        [null,<minecraft:bucket>,null],
        [<modularmachinery:itemmodularium>,<minecraft:bucket>,<modularmachinery:itemmodularium>],
        [null,<modularmachinery:blockfluidinputhatch>,null]
    ]
);

// Tiny Fluid Output Hatch
recipes.addShaped(
    <modularmachinery:blockfluidoutputhatch>*1,[
        [null,<modularmachinery:blockcasing>,null],
        [<modularmachinery:itemmodularium>,<minecraft:bucket>,<modularmachinery:itemmodularium>],
        [null,<minecraft:bucket>,null]
    ]
);

// Small Fluid Output Hatch
recipes.addShaped(
    <modularmachinery:blockfluidoutputhatch:1>*1,[
        [null,<modularmachinery:blockfluidoutputhatch>,null],
        [<modularmachinery:itemmodularium>,<minecraft:bucket>,<modularmachinery:itemmodularium>],
        [null,<minecraft:bucket>,null]
    ]
);

// Tiny Energy Input Hatch
recipes.addShaped(
    <modularmachinery:blockenergyinputhatch>*1,[
        [null,<modularmachinery:itemmodularium>,null],
        [<minecraft:redstone>,<modularmachinery:blockcasing>,<minecraft:redstone>],
        [<minecraft:repeater>,<modularmachinery:itemmodularium>,<minecraft:repeater>]
    ]
);

// Small Energy Input Hatch
recipes.addShaped(
    <modularmachinery:blockenergyinputhatch:1>,[
        [<minecraft:redstone_torch>,<modularmachinery:itemmodularium>,<minecraft:redstone_torch>],
        [null,<modularmachinery:blockenergyinputhatch>,null],
        [<minecraft:comparator>,<modularmachinery:itemmodularium>,<minecraft:comparator>]
    ]
);

// Tiny Energy Output Hatch
recipes.addShaped(
    <modularmachinery:blockenergyoutputhatch>,[
        [<minecraft:repeater>,<modularmachinery:itemmodularium>,<minecraft:repeater>],
        [<minecraft:redstone>,<modularmachinery:blockcasing>,<minecraft:redstone>],
        [null,<modularmachinery:itemmodularium>,null]
    ]
);

// Small Energy Output Hatch
recipes.addShaped(
    <modularmachinery:blockenergyoutputhatch>,[
        [<minecraft:comparator>,<modularmachinery:itemmodularium>,<minecraft:comparator>],
        [null,<modularmachinery:blockenergyinputhatch>,null],
        [<minecraft:redstone_torch>,<modularmachinery:itemmodularium>,<minecraft:redstone_torch>]
    ]
);